#ifndef MAINFRAME_H
#define MAINFRAME_H

#include <QtGui/QMainWindow>
#include "ui_mainframe.h"
#include "immgr.h"
#include "qbuddyface.h"
#include "QScrollArea"
class mainframe : public QMainWindow
{
	Q_OBJECT

public:
	mainframe(QWidget *parent = 0, Qt::WFlags flags = 0);
	~mainframe();

public Q_SLOTS:
	void OnClickItem();
	void OnClickIE();
	void OnBuddyListChange(CListUin *lstUin);
	void OnGroupListChange(CListUin *lstUin);
	void OnBuddyTeamChange(listuserteam *pListUserTeam);
	void OnDbClickBuddy();
	void OnDbClickGroup();
	void OnBuddyMsgCome(TXMSG::MsgPacket* pMsg);

protected:
	virtual void resizeEvent ( QResizeEvent * event );

private:
	struct ITEM_NODE
	{
		QPushButton *button;
		QScrollArea *scrollArea;
		QWidget *scrollAreaWidgetContents;
		QVBoxLayout *layout;
		BYTE id;
		int memberCount;
	};
	void createItem(QString & text, int nId = 0);

private:
	Ui::mainframeClass ui;
	std::vector<qbuddyface*> vecFriendLst;
	std::vector<qbuddyface*> vecGroupLst;
	std::vector<ITEM_NODE> vecItemLst;

	QVBoxLayout *verticalLayout;
};

#endif // MAINFRAME_H
